package com.adou.demo.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.adou.demo.entity.User;
/**
 * 用户
 * @author ADou
 * @date 2021年8月1日19:02:59
 */
@Mapper
public interface UserMapper {
	/**
	 * 查询
	 * @param name
	 * @return
	 */
	@Select("SELECT * FROM USERS WHERE NAME = #{name}")
	User findByName(@Param("name") String name);
	
	/**
	 * 添加
	 * @param name
	 * @param age
	 * @return
	 */
	@Insert("INSERT INTO USERS(NAME, AGE) VALUES(#{name}, #{age})")
	int insert(@Param("name") String name, @Param("age") Integer age);
}
